package com.atguigu.demo.customer.service.impl;

import com.atguigu.demo.customer.bean.Customer;
import com.atguigu.demo.customer.mapper.CustomerMapper;
import com.atguigu.demo.customer.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("cust1")
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    CustomerMapper customerMapper;

    @Override
    public Customer getCustomerById(Long id) {
        Customer customer = customerMapper.selectCustomerById(id);
        return customer;
    }

    @Override
    public void saveCustomer(Customer customer) {
        customerMapper.insertCustomer(customer);
    }


}
